﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;

namespace WpfSnqkGasAnalysis.Model
{
    /// <summary>
    /// 变量公共配置
    /// </summary>
    /// 创建时间：2022-11-22 17:38:12。作者：王浩力
    public struct CommonConfig
    {
        /// <summary>
        /// 数据库连接字符串。
        /// WAL支持读写并发。在DELETE模式下读写是互斥的。
        /// </summary>
        /// 创建时间：2022-11-22 17:38:12。作者：王浩力
        public static readonly string ConnectionStr = @$"Data Source={MyConfigReader.GetConfigValue("run_db_path")};Connect Timeout=30;Pooling=true;Journal Mode=WAL";
       

        /// <summary>
        /// 登录用户缓存key
        /// </summary>
        public const string LoginUserCacheKey = "loginUser";

        /// <summary>
        /// 超级账号
        /// </summary>
        public const string SupperUserAccount = "admin";

        /// <summary>
        /// 上传的图片保存目录
        /// </summary>
        /// 创建时间：2023-1-5 16:05:57
        public const string UploadImgSavePath = "uploadImg";

        /// <summary>
        /// 分页显示行数
        /// </summary>
        public const int PageSize = 15;

        /// <summary>
        /// 角色集合
        /// </summary>
        public readonly static List<string> RoleList = MyConfigReader.GetConfigList("role_list").ToArray().ToList();

        /// <summary>
        /// 步骤值，查询条件
        /// </summary>
        /// 创建时间：2023-1-16 14:43:25。
        public static Dictionary<int, string> StepList
        {
            get
            {
                //状态查询条件
                Dictionary<int, string> stepView = new Dictionary<int, string>();
                stepView.Add(-1, "请选择");
                stepView.Add(1, "待校对");
                stepView.Add(2, "待审核");
                stepView.Add(3, "被驳回");
                stepView.Add(4, "审核通过");
                return stepView;
            }
        }


    }
}
